package com.example.ktapplication.view

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.example.ktapplication.R


class CustomTitleBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
                                         defStyleAttr: Int = 0) :
    LinearLayout(context, attrs, defStyleAttr) {

     var imgMenu: ImageView? = null
     var imgFind: ImageView? = null
     var tvTitle: TextView? = null


    init {
        initView(context);
    }

   fun initView(context: Context){
      LayoutInflater.from(context).inflate(R.layout.layout_custom_titlebar,this,true);
       imgMenu = findViewById<ImageView>(R.id.img_menu);
       imgFind = findViewById<ImageView>(R.id.img_find);
       tvTitle = findViewById<TextView>(R.id.txt_title);
    }

    fun setTitleContent(title:String){
        tvTitle!!.setText(title)
    }
}